Skip to content

Fix: 캐시 직렬화 에러 수정#121

Merged
jaebeom79 merged 1 commit into
mainfrom
develop
Jun 1, 2026
Merged

Fix: 캐시 직렬화 에러 수정#121
jaebeom79 merged 1 commit into
mainfrom
develop

Conversation

@jaebeom79

Copy link
Copy Markdown
Contributor

📢 기능 설명

필요시 실행결과 스크린샷 첨부

연결된 issue

연결된 issue를 자동을 닫기 위해 아래 {이슈넘버}를 입력해주세요.

close #{이슈넘버}

✅ 체크리스트

  • PR 제목 규칙 잘 지켰는가?
  • 추가/수정사항을 설명하였는가?
  • 이슈넘버를 적었는가?

@jaebeom79 jaebeom79 merged commit 6381e2c into main Jun 1, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates Grafana dashboard configurations to filter out specific Kafka topics from Prometheus queries. It also configures a custom ObjectMapper for Redis caching in CacheConfig.java to support Java records and lists. A critical security issue was identified in CacheConfig.java, where using BasicPolymorphicTypeValidator with allowIfBaseType(Object.class) exposes the application to insecure deserialization and Remote Code Execution (RCE) vulnerabilities. It is recommended to restrict the allowed subtypes to specific packages or safe classes.

Comment on lines +49 to +51
BasicPolymorphicTypeValidator validator = BasicPolymorphicTypeValidator.builder()
.allowIfBaseType(Object.class)
.build();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-critical critical

BasicPolymorphicTypeValidator를 설정할 때 allowIfBaseType(Object.class)를 사용하는 것은 Java의 모든 객체(Object를 상속받는 모든 클래스)의 역직렬화를 허용하게 됩니다.\n\n주석에는 "Object 하위 타입만 허용해 deserialization gadget 위험 차단"이라고 작성되어 있으나, 실제로는 거의 모든 클래스가 Object를 상속받기 때문에 **알려진 모든 Deserialization Gadget(예: 원격 코드 실행을 유발하는 취약한 클래스들)의 역직렬화가 허용되어 심각한 보안 취약점(RCE)**이 발생할 수 있습니다.\n\n따라서 Object.class 전체를 허용하는 대신, 캐싱 대상이 되는 안전한 패키지 경로(예: com.catchtable)나 특정 클래스들만 허용하도록 제한해야 합니다.

        BasicPolymorphicTypeValidator validator = BasicPolymorphicTypeValidator.builder()\n                .allowIfSubType("com.catchtable")\n                .allowIfSubType(java.util.Collection.class)\n                .allowIfSubType(java.util.Map.class)\n                .build();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant